package com.mac.hosp_pre.admin.entity;

import cn.hutool.json.JSONUtil;
import com.mac.hosp_pre.admin.base.BaseMongoEntity;
import lombok.Data;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * Hospital
 *
 * @author mac
 */
@Data
@Document("Hospital")
public class Hospital extends BaseMongoEntity {
	
	private static final long serialVersionUID = 1L;
	
	@Indexed(unique = true) //唯一索引
	private String hospCode;

	@Indexed //普通索引
	private String hospName;

	private String hospType;

	private String provinceCode;

	private String cityCode;

	private String districtCode;

	private String address;

	private String logoData;

	private String intro;

	/**
	 * 坐车路线
	 */
	private String route;

	/**
	 * 状态 0：未上线 1：已上线
	 */
	private Integer state;

	private PreBookRule bookingRule;

	public void setBookingRule(String bookingRule) {
		this.bookingRule = JSONUtil.toBean(bookingRule, PreBookRule.class);
	}


}

